 package com.zonta.finance.domain.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 账套
 * </p>
 *
 * @author zonta
 * @since 2024-07-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("account_book")
@ApiModel(value="AccountBook对象", description="账套")
public class AccountBook implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "公司名称")
    private String companyName;

    @ApiModelProperty(value = "统一社会信用代码")
    private String unifiedSocialCreditCode;

    @ApiModelProperty(value = "行业代码id（取数据字典）")
    private Integer industryId;

    @ApiModelProperty(value = "增值税种类[0：小规模纳税人；1：一般纳税人]")
    private Integer valueAddedTaxCate;

    @ApiModelProperty(value = "凭证是否审核[0：不审核；1：审核]")
    private Boolean enableVoucherVerify;

    @ApiModelProperty(value = "账套启用年月")
    private Date startTime;

    @ApiModelProperty(value = "会计准则[0：小企业会计准则；1：企业会计准则；2：民间非盈利组织会计制度；3：农民专业合作社财务会计制度]")
    private Integer accountingStandard;

    @ApiModelProperty(value = "是否启用固定资产模块[0：不启用；1：启用]")
    private Boolean enableFixedAssets;

    @ApiModelProperty(value = "是否启用资金模块[0：不启用；1：启用]")
    private Boolean enableCapital;

    @ApiModelProperty(value = "是否启用进销存[0：不启用；1：启用]")
    private Boolean enablePsi;

    @ApiModelProperty(value = "是否禁用")
    private Boolean disable;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    private Date updateTime;

    @ApiModelProperty(value = "用户id")
    private Long memberId;

    @ApiModelProperty(value = "修改用户id")
    private Long updateMemberId;

    @ApiModelProperty(value = "是否删除，0：删除，1：未删除")
    private Boolean delFlag;

    @ApiModelProperty(value = "租户id")
    private Long tenantId;

    public void initDefault() {
        if (this.getCompanyName() == null) {
            this.setCompanyName("");
        }
        if (this.getUnifiedSocialCreditCode() == null) {
            this.setUnifiedSocialCreditCode("");
        }
        if (this.getIndustryId() == null) {
            this.setIndustryId(0);
        }
        if (this.getValueAddedTaxCate() == null) {
            this.setValueAddedTaxCate(0);
        }
        if (this.getEnableVoucherVerify() == null) {
            this.setEnableVoucherVerify(false);
        }
        if (this.getStartTime() == null) {
            this.setStartTime(new Date());
        }
        if (this.getAccountingStandard() == null) {
            this.setAccountingStandard(0);
        }
        if (this.getEnableFixedAssets() == null) {
            this.setEnableFixedAssets(false);
        }
        if (this.getEnableCapital() == null) {
            this.setEnableCapital(false);
        }
        if (this.getEnablePsi() == null) {
            this.setEnablePsi(false);
        }
        if (this.getDisable() == null) {
            this.setDisable(false);
        }
        if (this.getCreateTime() == null) {
            this.setCreateTime(new Date());
        }
        if (this.getUpdateTime() == null) {
            this.setUpdateTime(new Date());
        }
        if (this.getMemberId() == null) {
            this.setMemberId(0L);
        }
        if (this.getUpdateMemberId() == null) {
            this.setUpdateMemberId(0L);
        }
        if (this.getDelFlag() == null) {
            this.setDelFlag(false);
        }
        if (this.getTenantId() == null) {
            this.setTenantId(0L);
        }
    }
}
